<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>aaaa</title>
</head>

<body>
    <div id="app">
        <h2>123</h2>
        <span>456456</span>
        <span>9999</span>
        <span @click="btn">8888</span>
    </div>
</body>
<script>
    let getDoc = document.querySelector('#app');
    let btn = function(){
        alert(123123);
    }
    getDoc.childNodes.forEach((item, index) => {
        if (item.nodeType === 1) {
            if(item.getAttribute('@click')) item.getAttribute('@click')();
        }
    })
</script>

</html>